﻿<phone:PhoneApplicationPage x:Class="CDFWPUG.panMain"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                            xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                            xmlns:c="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71"
                            xmlns:c4f="clr-namespace:Coding4Fun.Phone.Controls;assembly=Coding4Fun.Phone.Controls"
                            mc:Ignorable="d"
                            d:DesignWidth="480"
                            d:DesignHeight="768"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource MyPhoneForegroundBrush}"
                            SupportedOrientations="Portrait"
                            Orientation="Portrait"
                            shell:SystemTray.IsVisible="True"
                            Loaded="PhoneApplicationPage_Loaded"
                            DataContext="{Binding PanMain, Source={StaticResource Locator}}" Background="{StaticResource MyPhoneBackgroundBrush}">


        <Grid x:Name="LayoutRoot"
          Background="{StaticResource MyPhoneBackgroundBrush}">
        <controls:Panorama Title="cardiff wpug" Foreground="{StaticResource MyPhoneForegroundBrush}">
            <controls:PanoramaItem>
                <ListBox x:Name="lbMain" Foreground="{StaticResource MyPhoneForegroundBrush}" ItemsSource="{Binding MainMenuItems}" Margin="0,-23,0,75" >
                	<i:Interaction.Triggers>
                		<i:EventTrigger EventName="SelectionChanged">
                			<c:EventToCommand Command="{Binding MainMenuSelectionCommand, Mode=OneWay}" PassEventArgsToCommand="True"/>
                		</i:EventTrigger>
                	</i:Interaction.Triggers>
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <ListBoxItem Width="430" Margin="0,0,0,5" toolkit:TiltEffect.IsTiltEnabled="True">
                                <StackPanel Orientation="Horizontal">
                                    <StackPanel Width="420">
                                        <TextBlock Foreground="{StaticResource MyPhoneForegroundBrush}" FontFamily="Segoe WP Black"
                                               Text="{Binding Title, Converter={StaticResource UpperCaseConverter}}"  FontWeight="Bold" FontSize="48" Margin="5,0,0,0"/>
                                        <TextBlock Text="{Binding Description}" Margin="5,0,0,0" TextWrapping="Wrap" Height="50" d:LayoutOverrides="HorizontalMargin" Style="{StaticResource MyPhoneTextAccentStyle}"/>
                                    </StackPanel>
                                </StackPanel>
                            </ListBoxItem>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </controls:PanoramaItem>
            <controls:PanoramaItem Header="group apps" Width="460" Orientation="Horizontal">
                <controls:PanoramaItem.HeaderTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding}" />
                             <c4f:RoundButton Name="btnGroupAppsRefresh" Margin="0,30,0,0" 
                                             ImageSource="/icons/appbar.refresh.rest.png" 
                                             Foreground="{StaticResource MyPhoneForegroundBrush}" 
                                             BorderBrush="{StaticResource MyPhoneForegroundBrush}" 
                                             Click="btnGroupAppsRefresh_Click">

                            </c4f:RoundButton>
                        </StackPanel>
                    </DataTemplate>
                </controls:PanoramaItem.HeaderTemplate>
                <StackPanel>
                    <TextBlock Name="tbGroupAppsMessage" Text="{Binding GroupAppsMessage}" 
                               Foreground="{StaticResource MyPhoneAccentBrush}" 
                               TextWrapping="Wrap" Style="{StaticResource MyPhoneTextAccentStyle}" />
                    <toolkit:PerformanceProgressBar 
						Name="pbGroupApps" 
						Visibility="{Binding GroupAppsLoading, Converter={StaticResource MyBooleanToVisibilityConverter}}"
						IsIndeterminate="True" Foreground="{StaticResource MyPhoneAccentBrush}" />
                    <ListBox Height="348" 
                         Name="listFeatured" 
                         SelectedItem="{Binding Path=SelectedApp, Mode=TwoWay}"
                         HorizontalAlignment="Left"
                         Width="444" ItemTemplate="{StaticResource AppListItem}" ItemsSource="{Binding Apps}">
                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="SelectionChanged">
                                    <c:EventToCommand PassEventArgsToCommand="True" Command="{Binding GroupAppSelectionCommand, Mode=OneWay}"/>
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                        </ListBox>
                    
                    <ListBoxItem toolkit:TiltEffect.IsTiltEnabled="True">
                    	<i:Interaction.Triggers>
                    		<i:EventTrigger EventName="MouseLeftButtonUp">
                    			<c:EventToCommand Command="{Binding ShowAllGroupAppsCommand, Mode=OneWay}" />
                    		</i:EventTrigger>
                    	</i:Interaction.Triggers>
                         <TextBlock 
                        Text="all apps"
                        toolkit:TiltEffect.IsTiltEnabled="True"
                        Style="{StaticResource MyPhoneTextExtraLargeStyle}"
                        />
                    </ListBoxItem>
                </StackPanel>
                
            </controls:PanoramaItem>
            <controls:PanoramaItem Header="upcoming" >
                <controls:PanoramaItem.HeaderTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding}" />
                            <c4f:RoundButton Margin="0,30,0,0" 
                                             ImageSource="/icons/appbar.refresh.rest.png" 
                                             Foreground="{StaticResource MyPhoneForegroundBrush}" 
                                             Name="btnMeetingRefresh"
                                             Click="btnMeetingRefresh_Click"
                                             BorderBrush="{StaticResource MyPhoneForegroundBrush}">
                                
                            </c4f:RoundButton>
                        </StackPanel>
                    </DataTemplate>
                </controls:PanoramaItem.HeaderTemplate>
                <StackPanel>
                    <TextBlock Name="tbMeetingMessage" Text="{Binding GroupMeetingMessage}" Foreground="{StaticResource MyPhoneAccentBrush}" TextWrapping="Wrap" Style="{StaticResource MyPhoneTextAccentStyle}" />
                    <toolkit:PerformanceProgressBar 
						Name="pbMeeting" 
						Visibility="{Binding GroupMeetingLoading, Converter={StaticResource MyBooleanToVisibilityConverter}}"
						IsIndeterminate="True" Foreground="{StaticResource MyPhoneAccentBrush}" />
                    <ListBox Name="lbMeetings" ItemsSource="{Binding UpcomingMeetings}" 
                         SelectedItem="{Binding Path=SelectedMeeting, Mode=TwoWay}"
                         ItemTemplate="{StaticResource UpcomingMeetingsItem}" Margin="0,0,0,71">
                	<i:Interaction.Triggers>
                		<i:EventTrigger EventName="SelectionChanged">
                			<c:EventToCommand PassEventArgsToCommand="True" Command="{Binding MeetingSelectionCommand, Mode=OneWay}"/>
                		</i:EventTrigger>
                	</i:Interaction.Triggers>
                </ListBox>  
                    
                </StackPanel>
                
            </controls:PanoramaItem>
            <controls:PanoramaItem Header="tweets" Width="460" Orientation="Horizontal">
                <controls:PanoramaItem.HeaderTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding}" />
                            <c4f:RoundButton Name="btnTwitterRefresh" Margin="0,30,0,0" 
                                             ImageSource="/icons/appbar.refresh.rest.png" 
                                             Foreground="{StaticResource MyPhoneForegroundBrush}" 
                                             BorderBrush="{StaticResource MyPhoneForegroundBrush}" 
                                             Click="btnTwitterRefresh_Click">

                            </c4f:RoundButton>
                        </StackPanel>
                    </DataTemplate>
                </controls:PanoramaItem.HeaderTemplate>
                <StackPanel Margin="0,-13,0,0">
                	<TextBlock Name="tbTwitterMessage" Text="{Binding TwitterMessage}" Foreground="{StaticResource MyPhoneAccentBrush}" TextWrapping="Wrap" Style="{StaticResource MyPhoneTextAccentStyle}" />
                	<toolkit:PerformanceProgressBar 
						Name="pbTwitter" 
						Visibility="{Binding TwitterLoading, Converter={StaticResource MyBooleanToVisibilityConverter}}"
						IsIndeterminate="True" Foreground="{StaticResource MyPhoneAccentBrush}" />
                    <ListBox Height="416" ItemsSource="{Binding Tweets}" 
                         Name="listTwitter"
                         HorizontalAlignment="Left"
                         Width="444" ItemTemplate="{StaticResource test}" >
                       
                    </ListBox>
                </StackPanel>

            </controls:PanoramaItem>
        </controls:Panorama>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="False" IsMenuEnabled="True" Opacity="0.8" Mode="Minimized" BackgroundColor="{StaticResource MyPhoneAccentColor}">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>